﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

#if SILVERLIGHT
using System.Windows;
using GameEngineSL.SilverlightCompatibility;
#else
using System.Drawing;
#endif

namespace GameEngine.Worlds
{
    public class Movable : Object, ITick
    {
        private float mass;
        private PointF velocity;

        public Movable()
        {
            mass = 1;
            velocity = new PointF();
        }

        /// <summary>
        /// Mass of the Object in Kilograms
        /// </summary>
        public float Mass
        {
            get
            {
                return mass;
            }
            set
            {
                mass = value;
            }
        }

        /// <summary>
        /// Speed of the Object in m/s
        /// </summary>
        public PointF Velocity
        {
            get
            {
                return velocity;
            }
            set
            {
                velocity = value;
            }
        }

        public override void Tick(float seconds)
        {
            PointF position = Position;
            position.X += velocity.X * seconds;
            position.Y += velocity.Y * seconds;
        }
    }
}
